--Norwich GPSTS CSA Event Timer Script ---you will need to place a suitable sound file of a school bell in the system sounds folder and amend the filenames below accordingly, we like it to ring twice --sets the system volume to max set volume 7 --we are going to loop, x is used to record the loops for display in the results set x to 1 --countdown from 10 to 1 say "10,,," say "9,,,," say "8,,," say "7,,," say "6,,," say "5,,," say "4,,,," say "3,,,," say "2,,,," say "1,,,," --number of repeats below is the number of stations, including any rest stations repeat 7 times --at the start of each station, play a bell sound and say "start station please" do shell script ("afplay /System/Library/Sounds/school_bell.caf") do shell script ("afplay /System/Library/Sounds/school_bell.caf") say "start,, station,, please" using "Alex" --display in the results log x & "Station started " & getTimeInHoursAndMinutes() --the delay below is the length of each station in minutes * 60 seconds delay 10 * 60 --at the end of each station, play a bell sound and say "stop station please" do shell script ("afplay /System/Library/Sounds/school_bell.caf") do shell script ("afplay /System/Library/Sounds/school_bell.caf") say "Stop,, station,, please" using "Alex" --display in the results log x & "Station stopped " & getTimeInHoursAndMinutes() --the overall time below is the gap between stations in minutes * 60 seconds delay 1 * 60 --increment x to update the station number in the result set x to x + 1 end repeat -- after all the stations finish say "This concludes the ,, GP ,,STS,, CSA,, event" using "Alex" --routine to get the time on getTimeInHoursAndMinutes() -- Get the "hour" set timeStr to time string of (current date) set Pos to offset of ":" in timeStr set theHour to characters 1 thru (Pos - 1) of timeStr as string set timeStr to characters (Pos + 1) through end of timeStr as string -- Get the "minute" set Pos to offset of ":" in timeStr set theMin to characters 1 thru (Pos - 1) of timeStr as string set timeStr to characters (Pos + 1) through end of timeStr as string --Get "AM or PM" set Pos to offset of " " in timeStr set theSfx to characters (Pos + 1) through end of timeStr as string return (theHour & ":" & theMin & " " & theSfx) as string --& theSfx end getTimeInHoursAndMinutes